﻿using Csb.RabbitMQ.Common.Components.RabbitMq.EasyNetQ;
using EasyNetQ;

namespace Csb.RabbitMQ.ClientApp
{
    internal class Program
    {
        static async Task Main(string[] args)
        {
            Console.WriteLine("RabbitMQ 发送消息客户端启动...");

            var bus = RabbitHutch.CreateBus("host=127.0.0.1;virtualHost=/;username=guest;password=guest");
            MQPublish mQPublish = new MQPublish(bus);
            string message = "clientMessage";
            for (int i = 0; i < 2000; i++)
            {
                await mQPublish.PublishMessageAsync("MQueue", $" [Client1] Sent {i+0}" + message);
                await Task.Delay(100);
            }
            Console.ReadLine();

        }
    }
}
